package com.example.feitiansys.service.badness.impl;

import com.example.feitiansys.mapper.BadnessMapper;
import com.example.feitiansys.pojo.Badness;
import com.example.feitiansys.service.badness.BadnessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author:武欣阳
 */
@Service
public class BadnessServiceImpl implements BadnessService {
    @Autowired
    private BadnessMapper badnessMapper;

    @Override
    public List<Badness> getAllBadness(Badness badness) {
        return badnessMapper.selectAllBadness(badness);
    }

    @Override
    public Integer addBadness(Badness badness) {
        return badnessMapper.insterBadness(badness);
    }

    @Override
    public boolean removeBadness(Integer id) {
        return badnessMapper.deleteBadness(id)>0;
    }

    @Override
    public boolean removeLeaveByIds(Object array) {
        return this.badnessMapper.deleteBadnessByIds(array)>0;
    }

    @Override
    public Integer changeBadness(Badness badness) {
        return badnessMapper.updateBadness(badness);
    }

    @Override
    public List<Badness> selectAllByLimit(int offset, int limit) {
        return this.badnessMapper.selectAllByLimit(offset,limit);
    }

    @Override
    public Badness selectBadnessById(Integer id) {
        return badnessMapper.selectBadnessById(id);
    }
}
